// 创建外壳组件
import React, {Component} from "react"
import Search from "./components/Search";
import List from "./components/List";
// 创建并暴露App组件
export default class App extends Component {
  state = {
    userList: [], // 用户列表
    isFirst: true, // 是否为第一次打开页面
    isLoading: false, // 是否是等待状态
    err: "" // 存储请求相关的错误信息
  }

  UpdateAppState = (stateObj) => {
    this.setState(stateObj)
  }


  render() {
    return (
      <div className="container">
        <Search UpdateAppState={this.UpdateAppState}/>
        <List { ...this.state }/>
      </div>
    )
  }
}